<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered ">
	<div class="modal-content">
					<div class="modal-header">
						<h6 class="modal-title">新增结算账户</h6>
						<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
					</div>
					<div class="modal-body">
					<form id="accountInfo-add-form" onsubmit="accountInfo.create();return false;">
					#include("_form.html")
					</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Close">关闭</button>
						<button type="button" class="btn btn-primary" onclick="accountInfo.create();">保存</button>
					</div>
				</div>
</div>

<script type="application/javascript">

$(function() {
	// 初始化bootstrap相关组件
	common.initBootstrap();
	
	formInput.listenkeyUp("#accountInfo-add-form");
	
	setTimeout(function() {
		$("#accountInfo_name").focus();
	}, 200);
	
});

accountInfo.create = function() {
	var result = accountInfo.formChecking();
	if(!result) {
		return;
	}
	
	beekit.ajaxPost("/fund/account/info/create", $("#accountInfo-add-form").serialize(), function(ret) {
		common.processRequestResult(ret, function(ret) {
			beekit.msg(ret);
			if (ret.state == "ok") {
				if('#(sourcePage)' == 'supplierFormPage') {
					beekit.modalChildClose();
					beekit.ajaxFillPage("/fund/account/info/optionList", {}, "#balance_account_id");
				} else {
					beekit.modalClose();
					accountInfo.list(ret.targetId);
				}
			}
		});
		
	});
};

</script>
